<template>
  <LoginOrRegister :isRegister="true" @onSubmit="onSubmit" />
</template>

<script>
import { registerAPI } from '@/api/user'
import LoginOrRegister from '../components/LoginOrRegister.vue'

export default {
  name: 'RegisterPage',
  components: { LoginOrRegister },
  methods: {
    async onSubmit (values) {
      const res = await registerAPI(values)
      console.log('注册', res)
      this.$toast('注册成功')
      this.$router.push('/login')
    }
  }
}
</script>

<style lang="less" scoped>
.link {
  color: #069;
  font-size: 12px;
  padding-right: 20px;
  float: right;
}
</style>
